<?php
 include "counter2.php";
 if (!$orderby) {
    $orderby = "f_mtime";
 }

pagestart(); ?>
<html>
<?php pagehead(_("Lost people")) ?>
<BODY>
<?php pagetop(_("Lost people")) ?>
<?php print _("These people are removed from the counter. Their data is still  preserved, but they are not included in the count.") ?>
<p>
<?php print _("If you want to, you can try to hunt them down and ask if they still  use Linux.") ?>
<p>
<?php
   $query = mysql_query("select count(*) from users where users.state = 'frozen'");
   if (!$query) {
       print _("MySQL error") . ": " . mysql_errno() . ":" . mysql_error() . "<br>";

	die("Query failed");
   }
   $r = mysql_fetch_row($query);
   print _("There are") . " " . $r[0] . " " . _("such people. Here are the oldest among them.");
 
   $query = mysql_query("select users.f_key, users.email, users.logintime, users.f_mtime from users where users.state = 'frozen' order by $orderby limit 50");

   if (!$query) {
       print _("MySQL error") . ": " . mysql_errno() . ":" . mysql_error() . "<br>";

	die("Query failed");
   }

   $thispage =  "http://" . $HTTP_HOST . "/" . $REQUEST_URI;


?>
<table class="info" border>
<tr><th><?php print _("Key") ?></th><th><?php print _("Email") ?></th><th><?php print _("Last login") ?></th><th><?php print _("Last touched") ?></th></tr>
<?php

  while ($arr = mysql_fetch_row($query)) {
	$arr[0] = htmlspecialchars($arr[0]);
	echo "<tr>";
	echo "<td>" . "<a href=\"display-person.php?user=$arr[0]\">$arr[0]</a>" . "</td>";
	echo "<td>" . htmlspecialchars($arr[1]) . "</td>";
	echo "<td>" . htmlspecialchars($arr[2]) . "</td>";
	echo "<td>" . htmlspecialchars($arr[3]) . "</td>";
	echo "</tr>";
 }
?>
</table>
<?php pagebottom() ?>
</body>
</html>
